package com.ytktt.study.week9.task3.rpcfx.exception;

import com.ytktt.study.week9.task3.rpcfx.enums.ErrEnum;
import lombok.Getter;

/**
 * TODO
 *
 * @author ytk
 */
@Getter
public class RpcfxException extends RuntimeException {

    private final Integer errCode;

    private final String errMessage;

    public RpcfxException(ErrEnum<?> errResponseEnum) {
        super();
        this.errCode = errResponseEnum.getErrCode();
        this.errMessage = errResponseEnum.getErrMsg();
    }

    public RpcfxException(ErrEnum<?> errResponseEnum, String errMessage) {
        super();
        this.errCode = errResponseEnum.getErrCode();
        this.errMessage = errMessage;
    }
}
